<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新增盘库-选择店铺</title>
<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
		<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="xt_main_right_center">
<form name="searchForm" id="searchForm" method="post" action="selectCheckStockShop.do">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
	<tr>
	  <td class="left-td-width-bg"  width="62" align="right">店号:</td>
	  <td class="right-td-width-bg-left" width="186" align="center">
	  <input class="input"  type="text" name="shopDto.shopMark" value="${shopDto.shopMark }" id="textfield2">
	    </td>
	  <td class="left-td-width-bg"  width="86" align="right">店名:</td>
	  <td class="right-td-width-bg-left" width="217" align="center">
	  	<input class="input"  type="text"name="shopDto.shopName" value="${shopDto.shopName }" id="textfield">
	  </td>
	  <td class="left-td-width-bg"  width="86" align="right">驻店员:</td>
	  <td class="right-td-width-bg-left" width="217" align="center">
	  	<jysz:autocompleter cssClass="input_ajax" name="shopUserName" classType="com.jysz.certificate.persistence.model.system.User" displayFields="realName" fieldMapping="{'shopUserId':'id'}" >
		</jysz:autocompleter>
	    <input type="text" style="display:none" id="shopUserId" name='shopUserId' class="input"  value="<s:property value="search.shopUserId"/>" style='width:120px'/>
	  </td>
    </tr>
	<tr>
    	<td style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x; "colspan="6" align="center">
    	<input type="submit" name="button2" class="btn_query" id="but" value="">
        <input type="reset" name="button" onClick="clearForm(this.form);return false;" class="btn_clear_form"  id="button" value=""></td>
    </tr>
</table>
</form>
</div>
 <table width="100%" border="0">
    <tr>
      <td align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
    </tr>
  </table>
  <table  width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td class="top-td-width-bg" width="3%">&nbsp;</td>
      <td class="top-td-width-bg" width="5%" height="43">序号</td>
      <td class="top-td-width-bg" width="13%">店号</td>
      <td class="top-td-width-bg" width="15%">店名</td>
      <td class="top-td-width-bg" width="25%">全称</td>
      <td class="top-td-width-bg" width="20%">驻店员</td>
      <td class="top-td-width-bg" width="25%">最近盘库日期</td>
    </tr>
    <s:iterator value="page.result" status="i" id="u">
    <tr>
      <td class="down-center-td-width-bg">  
      <input name="radio" type="radio" id="radio" value="${i.count }">
      <input type="hidden" id="mark${i.count }" value="${u.shopMark }"/>
      <input type="hidden" id="name${i.count }" value="${u.shopName }"/>
      <input type="hidden" id="id${i.count }" value="${u.id }"/>
      </td>
      <td class="down-center-td-width-bg">${i.count }</td>
      <td class="down-center-td-width-bg">${u.shopMark }</td>
      <td class="down-center-td-width-bg"><a href="javascript:closea('${u.shopMark }','${u.shopName }','${u.id }' )">${u.shopName }</a></td>
      <td class="down-center-td-width-bg">${u.company }</td>
      <td class="down-center-td-width-bg"><s:property value="findUserShopByShopId(id)"/></td>
      <td class="down-center-td-width-bg"><s:property value="getCheckStockDate(id)"/></td>
    </tr>
    </s:iterator> 
    <tr>
      <td colspan="5" align="center">    
      <a href="javascript:ok()"><img src="${contextPath}/images/xt_main_right_bottom_qd.png"/></a>    
          
      </td>
    </tr>
   
  </table>
   <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="99%" colspan="13" align="right"><%@ include file="/WEB-INF/view/common/pagination.jsp"%></td>
    </tr>
  </table>
  <p>&nbsp;</p>

<script type="text/javascript">
function jumpPage(page) {
	var searchForm = document.searchForm;
	searchForm.action = "<s:property value='contextPath'/>/system/treaty/selectCheckStockShop.do?currentPage=" + page;
	searchForm.submit();
}
function closea(hao,ming,id){
	window.opener.selectShopCallBack(hao, ming, id);
//	 window.opener.document.getElementById("textfield").value=hao;
//	 window.opener.document.getElementById("SHOPID").value=id;
//	 window.opener.document.getElementById("aaa").value=ming;
	 window.close();
}
function ok()
{ 
var temp=document.getElementsByName("radio");  
var x=null;
var bo=false;
for (var i=0;i<temp.length;i++){ 
	if(temp[i].checked) 
	 {
		
		x=temp[i].value; 
		bo=true;
	} 
	}
	if(bo==true){
		window.opener.selectShopCallBack(document.getElementById("mark"+x).value, document.getElementById("name"+x).value, document.getElementById("id"+x).value);
		window.close();
	}else{
	alert("请选择信息");	
	}

} 
</script>
 
</body>
</html>